﻿<ubcr:RibbonWindow x:Class="UBConDemo.Views.Ribbon.DefaultWindowView"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ubcr="http://schemas.ultimatebusinesscontrols.com/wpf/xaml/ribbon"
                    xmlns:ubcn="http://schemas.ultimatebusinesscontrols.com/wpf/xaml/navigation"
                    xmlns:skin="clr-namespace:UBCon.Ribbon.SkinManagers;assembly=UBCon.Ribbon"
                    xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
                    xmlns:viewModels="clr-namespace:UBConDemo.ViewModels"
                    Title="Ribbon Demo Application" 
                    WindowStartupLocation="CenterScreen"
                   x:Name="shell"
                    Icon="pack://application:,,,/UBConDemo;component/images/word2013-icon.png"
                   Theme="Classic">

    <ubcr:RibbonWindow.Resources>
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
        <BooleanToVisibilityConverter x:Key="converter" />
        <DataTemplate x:Key="itemTemplate">
            <Image Source="{Binding Image}"
        		Height="17"
        		Width="17"
        		HorizontalAlignment="Center"
        		VerticalAlignment="Center"
        		Margin="1"/>
        </DataTemplate>
        <DataTemplate x:Key="galleryItemTemplate" x:Shared="False">
            <Image Source="{Binding Image}"
        		Height="{Binding Path=ImageHeight, Mode=TwoWay, NotifyOnSourceUpdated=True}"
        		Width="{Binding Path=ImageWidth, Mode=TwoWay, NotifyOnSourceUpdated=True}"
        		HorizontalAlignment="Center"
        		VerticalAlignment="Center"
                   Stretch="Fill"/>
        </DataTemplate>
        <viewModels:RibbonWindowViewModel x:Key="viewModel"/>
        <Style TargetType="{x:Type ubcr:RibbonGalleryItem}" x:Key="optionMenuItemStyle">
            <Setter Property="MaxWidth" Value="300" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ubcr:RibbonGalleryItem}">
                        <ubcr:RibbonChrome RenderMouseOver="{TemplateBinding IsMouseOver}"
                                          RenderPressed="{TemplateBinding IsSelected}"
                                          x:Name="chrome"
                                          Background="{TemplateBinding Background}"
                                          BorderBrush="{TemplateBinding BorderBrush}"
                                          CornerRadius="0"
                                          InnerBorderCornerRadius="0">
                            <ContentPresenter ContentSource="Content"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                               ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"/>
                        </ubcr:RibbonChrome>

                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <DataTemplate x:Key="optionMenuItemTemplate">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Image Grid.RowSpan="2" 
                   Source="{Binding Path=ImageSource}" 
                   Width="32"
                   Height="32"/>
                <TextBlock Grid.Column="1" 
                       FontWeight="Bold"
                       Text="{Binding Title}"
                       TextWrapping="Wrap"
                       Margin="2"/>
                <TextBlock Text="{Binding Path=Description}"
                       Grid.Column="1"
                       Grid.Row="1"
                       TextWrapping="Wrap"
                       Margin="2"/>
            </Grid>
        </DataTemplate>
        <DrawingImage x:Key="CommandsCaptionImage" RenderOptions.BitmapScalingMode="Linear">
            <DrawingImage.Drawing>
                <DrawingGroup>
                    <GeometryDrawing  Geometry="M0,0 L12,0 L12,10 L0,10z" 
                                  Pen="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=_Pen1}}"/>
                    <GeometryDrawing  Geometry="M0,2.5 L12,2.5" 
                                  Pen="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=_Pen1}}"/>
                    <GeometryDrawing  Geometry="M4,5 L6,2.5 L8,5 L6,3.7z" 
                                  Brush="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=LightBlackBrush}}" 
                                  Pen="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=_Pen1}}"/>
                    <GeometryDrawing  Geometry="M6,2.5 L6,10" 
                                  Pen="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=_Pen1}}"/>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
    </ubcr:RibbonWindow.Resources>
    <ubcr:RibbonWindow.QAToolbarItems>
        <ubcr:RibbonButton Size="Small"
						   Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/cut.png"
                           ubcr:RibbonWindow.Text="Cut..."
                           Height="19"/>
        <ubcr:RibbonButton Size="Small"
						  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png"
                          ubcr:RibbonWindow.Text="Copy..."
                           Height="19"/>
        <ubcr:RibbonButton Size="Small"
						  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/formatpainter.png"
                          ubcr:RibbonWindow.Text="Clear..."
                           Height="19"/>
        <ubcr:RibbonSplitButton Size="Small"
						        Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/formatpainter.png"
                                ubcr:RibbonWindow.Text="Clear..."
                                Height="19"/>
        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/Underline/underline.png"
                                Height="19">
            <ubcr:RibbonGallerySet>
                <ubcr:RibbonGallery ItemsSource="{Binding Path=UnderlineItems, Source={StaticResource ResourceKey=viewModel}}"
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}">
                    <ubcr:RibbonGallery.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel />
                        </ItemsPanelTemplate>
                    </ubcr:RibbonGallery.ItemsPanel>
                </ubcr:RibbonGallery>
            </ubcr:RibbonGallerySet>
        </ubcr:RibbonSplitButton>
        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/highlight.png"
                                Height="19"/>
        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/fontcolor.png"
                                Height="19"/>
        <ComboBox ItemsSource="{Binding Source={x:Static Member=Fonts.SystemFontFamilies}}"
                                Width="130"
                                IsEditable="True"
                                Height="19"
                                VerticalAlignment="Center"
                                SelectedIndex="{Binding Path=SelectedIndex, ElementName=fontCombo, Mode=TwoWay}">
            <ComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="FontFamily" Value="{Binding Path=DataContext, RelativeSource={RelativeSource Mode=Self}}"/>
                    <Setter Property="Height" Value="23"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                </Style>
            </ComboBox.ItemContainerStyle>
        </ComboBox>
        <ubcr:RibbonComboBox ItemsSource="{Binding Source={x:Static Member=Fonts.SystemFontFamilies}}"
                                Width="130"
                                IsEditable="True"
                                Height="19"
                                VerticalAlignment="Center"
                                SelectedIndex="{Binding Path=SelectedIndex, ElementName=fontCombo, Mode=TwoWay}">
            <ubcr:RibbonComboBox.ItemContainerStyle>
                <Style TargetType="{x:Type ubcr:RibbonComboBoxItem}">
                    <Setter Property="FontFamily" Value="{Binding Path=DataContext, RelativeSource={RelativeSource Mode=Self}}"/>
                    <Setter Property="Height" Value="23"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                </Style>
            </ubcr:RibbonComboBox.ItemContainerStyle>
        </ubcr:RibbonComboBox>
        <ubcr:RibbonComboBox Width="40"
                             Height="19"
                             VerticalAlignment="Center"
                             SelectedIndex="{Binding Path=SelectedIndex, ElementName=fontSizeCombo, Mode=TwoWay}">
            <ubcr:RibbonComboBoxItem Content="8" />
            <ubcr:RibbonComboBoxItem Content="9" />
            <ubcr:RibbonComboBoxItem Content="10" />
            <ubcr:RibbonComboBoxItem Content="12" />
            <ubcr:RibbonComboBoxItem Content="14" />
            <ubcr:RibbonComboBoxItem Content="18" />
            <ubcr:RibbonComboBoxItem Content="20" />
            <ubcr:RibbonComboBoxItem Content="24" />
        </ubcr:RibbonComboBox>
    </ubcr:RibbonWindow.QAToolbarItems>
    <ubcr:RibbonWindow.CaptionItems>
        <ubcr:RibbonDropDownButton Width="28"
                                   Height="25"
                                   Image="{StaticResource ResourceKey=CommandsCaptionImage}"
                                   ubcr:RibbonHelper.ImageHeight="10"
                                   ubcr:RibbonHelper.ImageWidth="13"
                                   ubcr:RibbonWindow.EnableDefaulStyle="True"
                                   x:Name="optionsButton"
                                   ubcr:RibbonWindow.IsCollapsable="False">
            <ubcr:RibbonGallerySet>
                <ubcr:RibbonGallery ItemsSource="{Binding Path=OptionsButtonSource, Source={StaticResource ResourceKey=viewModel}}"  
                                    ItemTemplate="{StaticResource optionMenuItemTemplate}"
                                    ItemContainerStyle="{StaticResource ResourceKey=optionMenuItemStyle}"
                                    ParentMenu="{Binding ElementName=optionsButton}"
                                    StaysOpenOnSelection="False"
                                    x:Name="OptionsMenuGallery"
                                    SelectedItem="{Binding Path=SelectedOptionItem, Source={StaticResource ResourceKey=viewModel}, Mode=TwoWay}">
                    <ubcr:RibbonGallery.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel />
                        </ItemsPanelTemplate>
                    </ubcr:RibbonGallery.ItemsPanel>
                </ubcr:RibbonGallery>
            </ubcr:RibbonGallerySet>
        </ubcr:RibbonDropDownButton>

    </ubcr:RibbonWindow.CaptionItems>
    <!--<ubcr:RibbonWindow.QAToolbar>
        <ubcr:QAToolbar>
         
        </ubcr:QAToolbar>
    </ubcr:RibbonWindow.QAToolbar>-->
    <DockPanel LastChildFill="True" >
        <ubcr:RibbonBar DockPanel.Dock="Top"
			            SelectedIndex="0" 
                        Mode="{Binding Path=RibbonBarMode, Source={StaticResource ResourceKey=viewModel}, Mode=TwoWay}"
                        AnimatedOpen="True">
            <ubcr:RibbonBar.ApplicationMenu>
                <ubcr:ApplicationMenu Title="FILE"
                                      SelectedIndex="0"
                                      x:Name="AppMenu"
                                      Image="pack://application:,,,/UBConDemo;component/images/word2007.ico">
                    <ubcr:ApplicationMenuItem TitleContent="Info"
                                     Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/footer.png">
                        <Grid>
                            <TextBlock Text="Information" HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="75"
                               Foreground="Black"/>
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Create"
                                     Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/new.png">
                        <Grid>
                            <Button Content="Create" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Open"
                                     Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/open.png">
                        <Grid>
                            <Button Content="Open" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Save"
                                     Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/save.png">
                        <Grid>
                            <Button Content="Save" 
                            />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Save as..." Size="Large">
                        <Grid>
                            <Button Content="Save as..." />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Print">
                        <Grid>
                            <Button Content="Print" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Public access">
                        <Grid>
                            <Button Content="Public access" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Export">
                        <Grid>
                            <Button Content="Export" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Close"
                                     IsSelectable="False">
                        <Grid>
                            <Button Content="Close" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                    <ubcr:ApplicationMenuItem TitleContent="Profile">
                        <Grid>
                            <Button Content="Profile" />
                        </Grid>
                    </ubcr:ApplicationMenuItem>
                </ubcr:ApplicationMenu>
            </ubcr:RibbonBar.ApplicationMenu>
            <ubcr:RibbonTabItem Header="HOME"
                                x:Name="homeTab">
                <ubcr:RibbonGroup Header="Clipboard" HasLauncher="True">
                    <ubcr:RibbonButton Size="Large"
						              Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/paste.png"
						              Title="Paste"
                                      skin:SkinManager.Skin="Office2010"/>
                    <ubcr:RibbonButton Size="Small"
						              Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/cut.png"
                                      />
                    <ubcr:RibbonButton Size="Small"
						Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png"/>
                    <ubcr:RibbonButton Size="Small"
						Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/formatpainter.png"/>
                </ubcr:RibbonGroup>
                <ubcr:RibbonGroup Header="Font" 
                                 HasLauncher="True"
                                 Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/text.png">
                    <ubcr:GroupBox >
                        <ubcr:RibbonComboBox ItemsSource="{Binding Source={x:Static Member=Fonts.SystemFontFamilies}}"
                                            Width="130"
                                            SelectedIndex="0"
                                            IsEditable="True"
                                            x:Name="fontCombo"
                                            skin:SkinManager.Skin="Office2010">
                            <ubcr:RibbonComboBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ubcr:RibbonComboBoxItem}">
                                    <Setter Property="FontFamily" Value="{Binding Path=DataContext, RelativeSource={RelativeSource Mode=Self}}"/>
                                    <Setter Property="Height" Value="23"/>
                                    <Setter Property="VerticalAlignment" Value="Center"/>
                                </Style>
                            </ubcr:RibbonComboBox.ItemContainerStyle>
                        </ubcr:RibbonComboBox>
                        <ubcr:RibbonComboBox SelectedIndex="0"
                                            Width="40"
                                            x:Name="fontSizeCombo">
                            <ubcr:RibbonComboBoxItem Content="8" />
                            <ubcr:RibbonComboBoxItem Content="9" />
                            <ubcr:RibbonComboBoxItem Content="10" />
                            <ubcr:RibbonComboBoxItem Content="12" />
                            <ubcr:RibbonComboBoxItem Content="14" />
                            <ubcr:RibbonComboBoxItem Content="18" />
                            <ubcr:RibbonComboBoxItem Content="20" />
                            <ubcr:RibbonComboBoxItem Content="24" />
                        </ubcr:RibbonComboBox>
                        <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/font-increasesize.png" />
                        <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/font-decreasesize.png" />
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/ClearFormatting16.png" />
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/linecolor.png" />
                    </ubcr:GroupBox>
                    <ubcr:GroupBox>
                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/bold.png" x:Name="bold"
                                                 IsChecked="{Binding Path=AnimatedOpen, ElementName=AppMenu, Mode=TwoWay}"/>
                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/italic.png" IsChecked="{Binding Path=IsChecked, ElementName=bold, Mode=OneWay}"/>
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/Underline/underline.png">
                            <ubcr:RibbonGallerySet>
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=UnderlineItems, Source={StaticResource ResourceKey=viewModel}}"
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel />
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                            </ubcr:RibbonGallerySet>
                        </ubcr:RibbonSplitButton>

                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/Strikethrough16.png" />
                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/subscript.png" />
                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/superscript.png" />
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonDropDownButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/WordArt.png" />

                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/highlight.png" />
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/fontcolor.png" />
                    </ubcr:GroupBox>
                </ubcr:RibbonGroup>
                <ubcr:RibbonGroup Header="Paragraph" 
                                 HasLauncher="True"
                                 Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/aligncenter.png">
                    <ubcr:GroupBox>
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/list-bullets.png">
                            <ubcr:RibbonGallerySet >
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryBullets, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           x:Name="test2"
                                                           Header="Bullet library">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="210"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                            </ubcr:RibbonGallerySet>
                            <ubcr:RibbonSeparator Margin="1" Orientation="Horizontal"/>
                            <ubcr:DropDownMenuItem Header="Change List Level"
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/synchronizelist.png"/>
                            <ubcr:DropDownMenuItem Header="Define New Bullet..."/>
                        </ubcr:RibbonSplitButton>
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/list-numbered.png"
                                               UserCanResizeDropDown="True">
                            <ubcr:RibbonGallerySet IsFilterEnabled="True" Height="300">
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryNumbers, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Linrary">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="230"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryNumbers, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 0">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="230"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryBullets, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 1">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="230"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 2">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="230"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                                <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryBullets, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 3">
                                    <ubcr:RibbonGallery.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapPanel Width="230"/>
                                        </ItemsPanelTemplate>
                                    </ubcr:RibbonGallery.ItemsPanel>
                                </ubcr:RibbonGallery>
                            </ubcr:RibbonGallerySet>
                            <ubcr:RibbonSeparator Orientation="Horizontal"/>
                            <ubcr:DropDownMenuItem  Header="Change List Level"
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/synchronizelist.png">
                                <ubcr:RibbonGallerySet IsFilterEnabled="True" Height="300">
                                    <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryNumbers, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Linrary">
                                        <ubcr:RibbonGallery.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Width="230"/>
                                            </ItemsPanelTemplate>
                                        </ubcr:RibbonGallery.ItemsPanel>
                                    </ubcr:RibbonGallery>
                                    <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryNumbers, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 0">
                                        <ubcr:RibbonGallery.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Width="230"/>
                                            </ItemsPanelTemplate>
                                        </ubcr:RibbonGallery.ItemsPanel>
                                    </ubcr:RibbonGallery>
                                    <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryBullets, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 1">
                                        <ubcr:RibbonGallery.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Width="230"/>
                                            </ItemsPanelTemplate>
                                        </ubcr:RibbonGallery.ItemsPanel>
                                    </ubcr:RibbonGallery>
                                    <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 2">
                                        <ubcr:RibbonGallery.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Width="230"/>
                                            </ItemsPanelTemplate>
                                        </ubcr:RibbonGallery.ItemsPanel>
                                    </ubcr:RibbonGallery>
                                    <ubcr:RibbonGallery ItemsSource="{Binding Path=GalleryBullets, Source={StaticResource ResourceKey=viewModel}, NotifyOnSourceUpdated=True, Mode=TwoWay}" 
                                                           ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                           Header="Numbering Library 3">
                                        <ubcr:RibbonGallery.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Width="230"/>
                                            </ItemsPanelTemplate>
                                        </ubcr:RibbonGallery.ItemsPanel>
                                    </ubcr:RibbonGallery>
                                </ubcr:RibbonGallerySet>
                                <ubcr:DropDownMenuItem Header="Define New Number Format..."
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/strikeout.png">
                                    <ubcr:DropDownMenuItem Header="Define New Number Format..."
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/strikeout.png"/>
                                    <ubcr:DropDownMenuItem Header="Define New Number Style..."
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/SignatureLine.png"/>
                                </ubcr:DropDownMenuItem>
                                <ubcr:DropDownMenuItem Header="Define New Number Style..."
                                                       Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/SignatureLine.png"/>
                            </ubcr:DropDownMenuItem>
                            <ubcr:DropDownMenuItem Header="Define New Number Format..."
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/strikeout.png"/>
                            <ubcr:DropDownMenuItem Header="Define New Number Style..."
                                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/SignatureLine.png"/>
                        </ubcr:RibbonSplitButton>
                        <ubcr:RibbonDropDownButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/list-numbered-tb.png" />
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/indent.png"/>
                        <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/outdent.png"/>
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonButton  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/sortasc.png"/>
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/formatting-symbols.png"/>
                    </ubcr:GroupBox>
                    <ubcr:GroupBox>
                        <ubcr:RibbonRadioButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/aligncenter.png"/>
                        <ubcr:RibbonRadioButton x:Name="justify" Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/alignjustify.png"/>
                        <ubcr:RibbonRadioButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/alignleft.png"/>
                        <ubcr:RibbonRadioButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/alignright.png"/>
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonDropDownButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/expandspace.png"/>
                        <ubcr:RibbonSeparator />
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/fill.png"/>
                        <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/select.png"/>
                    </ubcr:GroupBox>
                </ubcr:RibbonGroup>
                <ubcr:RibbonGroup Header="Styles" 
                                 HasLauncher="True"
                                 Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/ChangeStyles32.png">
                    <ubcr:RibbonGallery VisibleItemsCount="4" 
						               x:Name="galleryItems"
						               ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
						               SelectedIndex="{Binding Path=SelectedIndex, ElementName=gal13, Mode=TwoWay}"
                                       ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}}">
                        <ubcr:RibbonGallery.DropDownGalleries>
                            <ubcr:RibbonGallery ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
								                x:Name="gal13"
                                                Width="290"
								                ItemContainerStyle="{DynamicResource ResourceKey={ComponentResourceKey ResourceId=DefaultItemContainerStyle, TypeInTargetAssembly={x:Type ubcr:RibbonGallery}}}"
								                ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}}"
                                                ScrollViewer.VerticalScrollBarVisibility="Auto"/>
                        </ubcr:RibbonGallery.DropDownGalleries>
                    </ubcr:RibbonGallery>
                </ubcr:RibbonGroup>
                <ubcr:RibbonGroup Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/find.png"
                                 Header="Editing">
                    <ubcr:RibbonSplitButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/find.png"
                                           Title="Find"/>
                    <ubcr:RibbonButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/refresh.png"
                                           Title="Replace"/>
                    <ubcr:RibbonDropDownButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/pointer.png"
                                           Title="Select"/>
                </ubcr:RibbonGroup>
            </ubcr:RibbonTabItem>
            <ubcr:RibbonTabItem Header="INSERT">
                <ubcr:RibbonGroup Header="Clipboard" HasLauncher="True"
                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png">
                    <ubcr:RibbonGallery VisibleItemsCount="4" 
						               ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
						               SelectedIndex="{Binding Path=SelectedIndex, ElementName=agalleryItems1, Mode=TwoWay}"
                                       ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}}"
                                       Name="agalleryItems"
                                        CanResizeDropDown="True">
                        <ubcr:RibbonGallery.DropDownGalleries>
                            <ubcr:RibbonGallery ItemTemplate="{StaticResource ResourceKey=galleryItemTemplate}"
                                                Width="290"
								                ItemContainerStyle="{DynamicResource ResourceKey={ComponentResourceKey ResourceId=DefaultItemContainerStyle, TypeInTargetAssembly={x:Type ubcr:RibbonGallery}}}"
                                                ItemsSource="{Binding Path=GalleryItemsSource, Source={StaticResource ResourceKey=viewModel}}"
                                                ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                x:Name="agalleryItems1"
                                                MinHeight="71"/>
                        </ubcr:RibbonGallery.DropDownGalleries>
                    </ubcr:RibbonGallery>
                    <ubcr:RibbonToggleButton Size="Large"
						                    Image="pack://application:,,,/UBConDemo;component/images/paste32.png"
						                    Title="Paste"
						                    x:Name="btn1"/>
                    <ubcr:RibbonToggleButton Size="Small"
						Image="pack://application:,,,/UBConDemo;component/images/cut32.png"
						x:Name="btn2"
						IsChecked="{Binding IsChecked, ElementName=btn1, Mode=TwoWay}"/>
                    <ubcr:RibbonButton Size="Small"
						Image="pack://application:,,,/UBConDemo;component/images/copy.png"/>
                    <ubcr:RibbonButton Size="Small"
						Image="pack://application:,,,/UBConDemo;component/images/Open_16x16.png"/>
                </ubcr:RibbonGroup>
                <ubcr:RibbonGroup Header="DropDownButtons" HasLauncher="True"
                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png">
                    <ubcr:RibbonDropDownButton Size="Large"
						                      Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/paste.png"
						                      Title="Paste"
                                              Command="{Binding Path=DataContext.OnPasteCommand, ElementName=shell, Mode=OneWay}"
                                               />
                    <ubcr:RibbonDropDownButton Size="Small"
						                      Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/cut.png"
                                              Title="Cut"/>
                    <ubcr:RibbonDropDownButton Size="Small"
						                       Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png"
                                               Title="Copy"/>
                    <ubcr:RibbonDropDownButton Size="Small"
						                       Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/formatpainter.png"
                                               Title="Painter"/>
                </ubcr:RibbonGroup>
            </ubcr:RibbonTabItem>
            <ubcr:RibbonTabItem Header="OutLookBar">
                <ubcr:RibbonGroup Header="OutlookBar" 
                                  HasLauncher="True"
                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/ChangeStyles32.png">
                    <ubcr:RibbonToggleButton Size="Large"
						                    Image="pack://application:,,,/UBConDemo;component/images/paste32.png"
						                    Title="AnimationsEnabled"
						                    x:Name="animationsEnabled"/>
                    <ubcr:RibbonToggleButton Size="Large"
						                    Image="pack://application:,,,/UBConDemo;component/images/Open_16x16.png"
						                    Title="DeferredDrag"
						                    x:Name="deferredDrag"/>
                </ubcr:RibbonGroup>
            </ubcr:RibbonTabItem>
            <ubcr:RibbonTabItem Header="PAGE LAYOUT" />
            <ubcr:RibbonTabItem Header="CONTEXTUAL TAB ITEMS">
                <ubcr:RibbonGroup Header="Contextual tab items">
                    <ubcr:RibbonToggleButton Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/paste.png" 
                                             Size="Large"
                                             x:Name="btn3"
                                             Title="Paste"/>
                    <ubcr:RibbonToggleButton x:Name="center" 
                                            Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/ChangeStyles32.png"
                                            Size="Large"
                                            Title="Style"
                                             />
                </ubcr:RibbonGroup>
            </ubcr:RibbonTabItem>
            <ubcr:RibbonBar.ContextualItems>

                <ubcr:ContextualTabItemsGroup Title="TABLE TOOLS" 
                                              Visibility="{Binding Path=IsChecked, ElementName=center, Converter={StaticResource ResourceKey=converter}}"
                                              Brush="Orange"
                                              DefaultIndex="0">
                    <ubcr:RibbonTabItem Header="DESIGN" IsSelected="True" />
                    <ubcr:RibbonTabItem Header="LAYOUT"/>
                </ubcr:ContextualTabItemsGroup>
                <ubcr:ContextualTabItemsGroup Title="TEMPLATE" 
                                              Visibility="{Binding Path=IsChecked, ElementName=btn3, Converter={StaticResource ResourceKey=converter}}"
                                              Brush="Green"
                                              DefaultIndex="0">
                    <ubcr:RibbonTabItem Header="HOME" />
                </ubcr:ContextualTabItemsGroup>
                <ubcr:ContextualTabItemsGroup Title="TABLE TOOLS" 
                                              Brush="Red"
                                              Visibility="{Binding Path=IsChecked, ElementName=center, Converter={StaticResource ResourceKey=converter}}"
                                              x:Name="t2"
                                              DefaultIndex="1">
                    <ubcr:RibbonTabItem Header="DESIGN">
                        <ubcr:RibbonGroup Header="Clipboard" HasLauncher="True"
                                  Image="pack://application:,,,/UBConDemo;component/images/RibbonBar/copy.png">
                            <ubcr:RibbonToggleButton Size="Large"
						                    Image="pack://application:,,,/UBConDemo;component/images/paste32.png"
						                    Title="Paste"
						                    x:Name="btn11"/>
                            <ubcr:RibbonToggleButton Size="Small"
						                         Image="pack://application:,,,/UBConDemo;component/images/cut32.png"
						                         x:Name="btn22"
						                         IsChecked="{Binding IsChecked, ElementName=btn11, Mode=TwoWay}"/>
                            <ubcr:RibbonButton Size="Small"
						                   Image="pack://application:,,,/UBConDemo;component/images/copy.png"/>
                            <ubcr:RibbonButton Size="Small"
						                   Image="pack://application:,,,/UBConDemo;component/images/Open_16x16.png"/>
                        </ubcr:RibbonGroup>
                    </ubcr:RibbonTabItem>
                    <ubcr:RibbonTabItem Header="LAYOUT"/>
                </ubcr:ContextualTabItemsGroup>
            </ubcr:RibbonBar.ContextualItems>
        </ubcr:RibbonBar>
    </DockPanel>

    <ubcr:RibbonWindow.Footer>
        <Border TextBlock.Foreground="White"
                Height="23"
                Background="{DynamicResource ResourceKey={ComponentResourceKey TypeInTargetAssembly={x:Type skin:SkinManager}, ResourceId=FooterBackground}}">
            <Grid VerticalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="55" />
                    <ColumnDefinition Width="55" />
                    <ColumnDefinition Width="55" />
                    <ColumnDefinition Width="55" />
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition Width="100" />
                </Grid.ColumnDefinitions>
                <TextBlock  Text="Ready" 
                            HorizontalAlignment="Left"
                            Margin="5, 0, 0, 0"/>
                <TextBlock  Text="Ln 294" 
                            HorizontalAlignment="Left"
                            Margin="5, 0, 0, 0"
                            Grid.Column="1"/>
                <TextBlock  Text="Col 38" 
                            HorizontalAlignment="Left"
                            Margin="5, 0, 0, 0"
                            Grid.Column="2"/>
                <TextBlock  Text="Ch 37" 
                            HorizontalAlignment="Left"
                            Margin="5, 0, 0, 0"
                            Grid.Column="3"/>
                <TextBlock  Text="Ch 37" 
                            HorizontalAlignment="Left"
                            Margin="5, 0, 0, 0"
                            Grid.Column="4"/>
            </Grid>
        </Border>
    </ubcr:RibbonWindow.Footer>
</ubcr:RibbonWindow>
